<%@page import="com.fractalist.man.constants.ManConstants"%>
<%@page import="com.fractalist.base.core.constants.SystemConstants"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	pageContext.setAttribute("baseweburl",
			SystemConstants.UPLOAD_WEB_URL);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>节目</title>
<link rel="stylesheet" href="${ctx }/css/styles.css" type="text/css" />
<script type="text/javascript" src="${ctx }/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="${ctx }/js/jquery.form.js"></script>
<jsp:include page="/common/jscalendar.jsp"></jsp:include>
</head>
<body style="overflow-y: scroll;">
	<script>
		var baseweburl = "${baseweburl}";


		function createScoreRule() {
					
			var scoreRuleId = $("#scoreRuleId").val();
			var scoreRuleName = $("#scoreRuleName").val();
			var scoreRuleAction = $("#scoreRuleAction").val();
			var score = $("#score").val();
			if (!/^[0-9-]+$/gim.test(score)) {
				alert("请输入有效积分，必须为整数");
				return;
			}
			if(scoreRuleName == ""){
				alert("请输入策略名称");
				return;
			}
			if(scoreRuleAction == ""){
				alert("请输入策略对应action名称");
				return;
			}
			$.post("${ctx}/manager/createScroeRule.action", {
				scoreRuleId : scoreRuleId,
				scoreRuleName : scoreRuleName,
				scoreRuleAction : scoreRuleAction,
				score : score
			}, function(data) {
				location.href = "${ctx}/manage/viewScroeRulePage.action";
			})
		}
	</script>
	<div id="wrapper">
		<div id="content_wrap">
			<div class="tabs_content">
				<div class="active_tab" id="tab1"></div>
				<div id="table_wrapper" style="width: 100%; overflow: auto;">
					<table class="table" cellpadding="0" cellspacing="0">
						<input type="hidden" name="scoreRuleId" id="scoreRuleId"
							value="${scoreRule.id }" />
						<tr>
							<td>策略名称</td>
							<td><input id="scoreRuleName" name="scoreRuleName"
								value="${scoreRule.name }" /></td>
						</tr>
						<tr>
							<td>策略对应action名称</td>
							<td><input id="scoreRuleAction" name="scoreRuleAction"
								value="${scoreRule.action }" /></td>
						</tr>
						<tr>
							<td>策略积分</td>
							<td><input id="score" name="score"
								value="${scoreRule.score }" /></td>
						</tr>
						<tr>
							<td></td>
							<td><input type="button" value="提交" onclick="createScoreRule();" /></td>
						</tr>
					</table>
				</div>
			</div>
		</div>
	</div>
	</div>
</body>
</html>

